package 蓝桥真题;

import java.time.LocalDate;

public class 含2天数 {
       public static void main(String[] args) {
		      int days[]={-1,31,28,31,30,31,30,31,31,30,31,30,31};
		      int res=0;
		      long t=System.currentTimeMillis();
		      for(int year=1900;year<=9999;year++){
		    	  if(year%400==0||(year%4==0&&year%100!=0))
		    		  days[2]=29;
		    	  else days[2]=28;
		    	  for(int month=1;month<=12;month++){
		    		  for(int day=1;day<=days[month];day++)
		    			  if(String.valueOf(year).intern().contains("2")||String.valueOf(month).intern().contains("2")||String.valueOf(day).intern().contains("2"))
		    				  res++;
		    	  }
		      }
		      System.out.println((System.currentTimeMillis()-t));
		      System.out.print(res);
		      
	}
}
